package com.tch.mapper;


import com.tch.entity.Plain;
import com.tch.entity.RefundPay;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderMapper {

    @Select("select count(1) as count from t_plain where 1=1 and insert_date <sysdate-10/1440 and order_status='X'")
    int findcount();


    @Select("select order_no as orderNo from t_plain where 1=1 and insert_date <sysdate-10/1440 and order_status='X' and rownum<2")
    Plain findinfo();

    @Select("select count(1) as count from tc_webjj.t_refund_pay where refund_status='2'")
    int refundPayCount();

    @Select("select id,orderNo,refundAmt,refundType,refundSeq,payType,busNo,payLogId from (select id,order_no as orderNo,refund_amt as refundAmt,refund_type as refundType,refund_seq as refundSeq,pay_type as payType,bus_no as busNo,pay_log_id as payLogId from tc_webjj.t_refund_pay where refund_status='2' order by insert_date) where 1=1 and rownum<2 ")
    RefundPay crjRefundPay();

    //一件事办理14
    @Select("select u.sdono as sdono from tc_webjj.t_dobus u,tc_webjj.t_onething_a_time_dobus t where t.sdono=u.sdono and u.state='14' and to_date('2023-01','yyyy-mm')< u.ddecdate and rownum<2") //2022-12
    List<String> getSdono();

    //12
    @Select("select u.sdono as sdono from tc_webjj.t_dobus u,tc_webjj.t_onething_a_time_dobus t where t.sdono=u.sdono and u.state='12' and to_date('2023-01','yyyy-mm')< u.ddecdate and rownum<2") //2022-12
    List<String> getSdono12();
}
